<?php 
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$w=$_REQUEST['winW']*98/100;
$mm=$w."px";
$c1=$w*4/100 ;
$c2=$w*5/100 ;
$c3=$w*18/100 ;
$c4=$w*6/100 ;
$c5=$w*6/100 ;
$c6=$w*6/100 ;
$c7=$w*20/100 ;
$c8=$w*4/100 ;
$c9=$w*10/100 ;
$c10=$w*6/100 ;
$c11=$w*9/100 ;
$c12=$w*6/100 ;

$connection1 = mysql_connect("1.234.20.151", "cam", "5678" ) ;
mysql_select_db("elicam", $connection1);
mysql_query("set names 'utf8'");
$sql = 'SELECT cf.id,cf.`name`,cf.`host`,cf.pos_x,cf.pos_y,cf.go_mode,cf.DVR,cf.IP,cf.`Port`,cf.UserID,cf.PW FROM `configcamera` cf order by cf.live_time desc';
$rs=mysql_query($sql);
$mang=array();
include 'classscroll.php';
while($row=mysql_fetch_array($rs)){
	$ob=new scrollclass();
	$ob->newwscroll($row['id'], $row['name'], $row['pos_x'], $row['pos_y'], $row['go_mode'], $row['host'], $row['DVR'], $row['IP'], $row['Port'], $row['UserID'],$row['PW']);
	$mang[]=$ob;
}
mysql_close($connection1);
?>
	<table cellspacing="0" cellpadding="0" border="0" width="<?php echo $mm;?>" >
	  <tr>
	    <td>
	       <table cellspacing="0" cellpadding="0" border="1" width="<?php echo $mm;?>" >
	         <tr>
	            <th width="<?php echo $c1."px";?>">No</th>
	            <th width="<?php echo $c2."px";?>">ID</th>
	            <th width="<?php echo $c3."px";?>">Name</th>
	            <th width="<?php echo $c4."px";?>">pos_x</th>
	            <th width="<?php echo $c5."px";?>">pos_y</th>
	            <th width="<?php echo $c6."px";?>">mode</th>
	            <th width="<?php echo $c7."px";?>">server</th>
	            <th width="<?php echo $c8."px";?>">DVR</th>
	            <th width="<?php echo $c9."px";?>">IP</th>
	            <th width="<?php echo $c10."px";?>">Port</th>
	            <th width="<?php echo $c11."px";?>">UserID</th>
	            <th width="<?php echo $c12."px";?>">PW</th>
	         </tr>
	       </table>
	    </td>
	  </tr>
	  <tr>
	    <td>
	       <div id="show" style="width:$mm; height:600px; overflow-y:auto; overflow-x:hidden;  clip-rect:(0px,$mm, 600px, 0px);" >
	       <?php 
	       ?>
	         <table cellspacing="0" cellpadding="0" border="1" width="<?php echo $mm;?>" >
	         <?php 
	         $i=0;
	        	if(!empty($mang)){
	        		foreach ($mang as $k=>$gt){
	        			$obj=unserialize (serialize ($gt));
	         ?>
	           <tr>
	             <td width="<?php echo $c1."px";?>"><?=(++$i)?></td>
	             <td width="<?php echo $c2."px";?>"><?=$obj->id?></td>
	             <td width="<?php echo $c3."px";?>"><?=$obj->name?></td>
	             <td width="<?php echo $c4."px";?>"><?=$obj->posx?></td>
	             <td width="<?php echo $c5."px";?>"><?=$obj->posy?></td>
	             <td width="<?php echo $c6."px";?>"><?=$obj->mode?></td>
	             <td width="<?php echo $c7."px";?>"><?=$obj->server?></td>
	             <td width="<?php echo $c8."px";?>"><?=$obj->dvr?></td>
	             <td width="<?php echo $c9."px";?>"><?=$obj->ip?></td>
	             <td width="<?php echo $c10."px";?>"><?=$obj->port?></td>
	             <td width="<?php echo $c11."px";?>"><?=$obj->userid?></td>
	             <td width="<?php echo $c12."px";?>"><?=$obj->pw?></td>
	           </tr>
	          <?php } }?>
	         </table>  
	       <?php 
	       ?>
	       </div>
	    </td>
	  </tr>
	</table>